<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/jquery-3.4.1.min.js" type="text/javascript"></script>
</head>
<body>
    <div>
        <label for="fileName">文件名</label>
        <input id="fileName" name="fileName" type="text" value=""/>
    </div>
    <div>
        <label for="total">总行数</label>
        <input id="total" name="total" type="text" value=""/>
    </div>
    <div>
        <label for="keyword"></label>
        <input id="keyword" name="keyword" type="text" value=""/>
        <input id="search" value="search" type="button">
    </div>
    <div id="contents">

    </div>
    <script type="text/javascript">
        $.get('total',{},function (data) {
            $("#fileName").val(data.fileName);
            $("#total").val(data.total);
            console.log(data);
        });
        $("#search").bind('click',function () {
            $.get('search?total='+$("#total").val()+'&keyword='+$("#keyword").val(),{},function (data) {
                console.log(data);
                for(i=0;i<data.contents.length;i++){
                    $("#contents").append(data.contents[i]+'<br>')
                }
            });
        })
    </script>
</body>
</html>